﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace EntityBinder.Interface
{
	/// <summary>
	/// Interface to access member of class using reflection (fields, property...)
	/// </summary>
	public interface IMemberAccess
	{
		/// <summary>
		/// Name of the member.
		/// </summary>
		string Name { get; }

		/// <summary>
		/// Type of the member.
		/// </summary>
		Type Type { get; }

		/// <summary>
		/// Return the current value of a member based on its name.
		/// </summary>
		/// <param name="_data">The container object of the member.</param>
		/// <returns>The current value of the member.</returns>
		object Get(object _data);

		/// <summary>
		/// Set the value of a member.
		/// </summary>
		/// <param name="_data">The container object of the member.</param>
		/// <param name="_value">The new value of the member.</param>
		void Set(object _data, object _value);
	}
}
